package com.qingcloud.adminbackend.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.qingcloud.adminbackend.base.AjaxResult;
import com.qingcloud.adminbackend.entity.equipment.ModelDTO;
import com.qingcloud.adminbackend.entity.sysstation.*;
import com.qingcloud.adminbackend.entity.sysstation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 * 监测点信息表 服务类
 * </p>
 *
 * @author luozehua
 * @since 2019-04-10
 */
public interface ISysStationService extends IService<SysStation> {
    /**
     * 监测点详情
     *
     * @param stationId
     * @return
     */
    StationDetailsDTO details(String stationId, String userId, boolean isAdmin);

    /**
     * 删除监测点
     *
     * @param stationIds
     * @return
     */
    int delete(List<String> stationIds, String userId);

    /**
     * 上线监测点
     *
     * @param stationIds
     */
    void online(List<String> stationIds);

    /**
     * 下线监测点
     *
     * @param stationIds
     */
    void offline(List<String> stationIds);

    /**
     * 新业务设置共享
     *
     * @param stationShareTimeDTO
     */
    Integer share(StationShareTimeDTO stationShareTimeDTO, String userId);

    /**
     * 根据站点ID查询所选站点的共享信息
     *
     * @param shareStationPageDTO
     * @return
     */
    IPage<StationShareDTO> selectShareByPage(ShareStationPageDTO shareStationPageDTO);

    List<StationShare> selectShare(List<String> stationIds);

    /**
     * 绑定设备获取绑定信息
     *
     * @param stationId
     * @return
     */
    Map<String, Object> mount(String stationId);

    /**
     * 批量绑定设备
     *
     * @param excelFile
     * @param userId
     * @return
     */
    AjaxResult batchMount(MultipartFile excelFile, Integer businessType, String userId, Boolean isAdmin);

    Integer addStation(AddStationDTO addStationDTO, String userId);

    /**
     * 分页查询监测点列表
     *
     * @param stationListPara
     * @param stationIds
     * @param userId
     */
    IPage<StationListDTO> listStation(StationListPara stationListPara, List<ModelDTO> stationIds, String userId);

    /**
     * 网格化监测点导入
     *
     * @param file
     * @param userId
     * @return
     */
    AjaxResult stationExcel(MultipartFile file, String userId, String orderId) throws IOException;

    /**
     * 健康空气监测点导入
     *
     * @param file
     * @param userId
     * @return
     */
    AjaxResult stationExcelJKKQ(MultipartFile file, String userId, String orderId) throws IOException;

    /**
     * 导出数据
     *
     * @param stationListPara
     * @param stationIds
     * @param userId
     * @return
     */
    List<StationExportDTO> exportData(StationListPara stationListPara, List<ModelDTO> stationIds, String userId);

    /**
     * 处理共享时间段
     *
     * @param temp
     * @return
     */
    void hanldShareInfo(List<StationExportDTO> temp);

    /**
     * 根据订单编号查询监测点信息
     *
     * @param orderId      订单编号
     * @param businessType 业务种类
     */
    List<StationProjectInfoDTO> findByOrder(String orderId, Integer businessType);

    /**
     * 查询监测点的订单信息
     *
     * @param sidSet
     * @return
     */
    List<StationProjectInfoDTO> findStationOrder(Set<String> stationIdSet);

    /**
     * 监测点同步信息
     *
     * @param businessType 业务种类
     * @return
     */
    List<StationSyncDTO> findStationSyncInfo(Integer businessType);

    /**
     * 监测点绑定信息
     */
    List<StationBindDTO> findStationBindSync(Set<String> stationIdSet);

}
